<template>
  <!--线上课程-->
  <div>
    <carousel :autoplaySpeed="autoplaySpeed" :Img="Img"></carousel>
    <v_menu :title="data.title" :site="data.list[activeIndex].list"></v_menu>

    <Row :gutter="16" class="wrapper">
      <i-col span="19" class="content">
        <div style="margin: 10px;text-align: center;font-size: 18px;font-weight: bold">
          温馨提示：仅为实例视频，正式网站会显示投稿相关课程！
        </div>

        <div style="padding: 20px 0">
          <Row :gutter="16" style="padding-bottom: 10px">
            <i-col span="12" v-for="lists in list">
              <lesson :Data="lists"></lesson>
            </i-col>
          </Row>
        </div>
      </i-col>
      <i-col span="5" class="navigation">
        <ngn :data="data" :activeIndex="activeIndex"></ngn>
      </i-col>
    </Row>

    <!--Vue组件-->
    <div class="page">
      <paging :all="all" @returnValue="returnValue"></paging>
    </div>
  </div>
</template>

<script>
  import carousel from '../module/carousel'
  import ngn from '../module/ngn'
  import lesson from '../module/lesson'
  import paging from '../module/paging'
  import v_menu from '../module/menu'

  export default {
    components: {carousel, ngn, lesson, paging, v_menu},
    data() {
      return {
        activeIndex: 1,
        autoplaySpeed: 100000,
        onlineCourses2Link: this.$api.url + '/online/classes/list/all/',
        all: 1,
        cur: 1,
        Img: [
          {
            id: 1,
            imageLocation: require('../../assets/img/u69.jpg'),
            state: true,
            uri: "",
          },
        ],
        data: {
          title: '资讯中心',
          list: [
            {list: '期刊动态', link: 'JournalofInformation',},
            {list: '线上课程', link: 'onlineCourses2',},
            {list: '政策法规', link: 'policiesRegulations'},
            {list: '特别策划', link: 'SpecialPlanning'},
            {list: '公告通知', link: 'announcementNotice'},
          ],
        },
        list: [],

        pdfUrl: ''

      }
    },
    mounted() {
      this.dataArray()
    },
    methods: {
      returnValue(data) {
        this.cur = data;
        this.dataArray()
      },
      dataArray() {
        this.$axios.get(this.onlineCourses2Link + this.cur).then((res) => {
          this.all = res.data.data.totalPage;
          this.list = res.data.data.lists
        });
      },
    },
  }
</script>

<style scoped>
  /*主要内容*/
  .wrapper .content {
    border-right: 1px solid #ccc;
    min-height: 300px;
  }

  .wrapper .navigation {
    padding-left: 0 !important;
  }
</style>
